import EventDispatcher from "./EventDispatcher";
const { ccclass, property } = cc._decorator;

@ccclass
export default class EventMgr {
    static listen(e, t, a, o?) {
        this.dispatcher.off(e, a, t);
        this.dispatcher.on(e, a, t, o);
    };
    static ignore(e, t, a) {
        this.dispatcher.off(e, a, t, false);
    };
    static ignoreAllByEvent(e) {
        this.dispatcher.offAll(e);
    };
    static ignoreAllByCaller(e) {
        this.dispatcher.offAllCaller(e);
    };
    static trigger(e, t?) {
        this.dispatcher.event(e, t);
    };
    static dispatcher = new EventDispatcher();
}